<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>显示和隐藏</title>
    <style type="text/css">
 #div1{
     width:200px;
     height: 200px;
     background-color: #999999;

 }

#div1:hover{
    /*隐藏之后脱离文档流*/
    display: none;
}
#div2{
    background-color: #4E6B33;
    width:200px;
    height: 200px;
}
#div2:hover{
    /*隐藏之后不脱离文档流*/
    visibility: hidden;
}
 #div3{
     background-color:#0382AD;
     width:200px;
     height: 200px;
 }
    </style>
</head>
<body>
<div id="div1"></div>
<hr>
<div id="div2"></div>
<div id="div3"></div>

</body>
</html>